# !/usr/bin/env python
# -*-coding:utf-8 -*-

"""
# Author     ：skyTree
# version    ：python 3.11
# Description：商品schemas
"""
from pydantic import BaseModel
from typing import Union,List

from schemas.base import DetailBaseResp, PageResponse


class AttrSchemas(BaseModel):
    id: int
    name: str
    val: str
    _type: str
    cid_id: int


class GoodAddSchemas(BaseModel):
    name: str
    price: Union[float, None] = None
    number: Union[int, None] = None
    introduce: Union[str, None] = None
    big_log: Union[str, None] = None
    small_log: Union[str, None] = None
    state: int
    is_promote: int
    hot_number: Union[int, None] = None
    weight: Union[int, None] = None

    cid_one_id:  Union[int, None] = None
    cid_two_id:  Union[int, None] = None
    cid_three_id:  Union[int, None] = None

    static_attrs: Union[list, None] = None
    dynamic_attrs: Union[list, None] = None


class GoodSchemas(GoodAddSchemas):
    id: int
    static_attrs: List[AttrSchemas] = []
    dynamic_attrs: List[AttrSchemas] = []


class GoodResponseSchemas(DetailBaseResp):
    data: GoodSchemas


class GoodListResponseSchemas(DetailBaseResp):
    data: PageResponse
